<div id="dish-tabs">
	<ul>
		<li><a href="#add-dish-tab">添加菜式</a></li>
		<!-- <li><a href="#put-dish-tab">修改菜式</a></li> -->
	</ul>
	<div id="add-dish-tab">
		<p><b>添加菜式</b></p>
		<table>
			<tr>
				<td>
					<table>
						<tr>
							<td>菜式名称</td>
							<td>
								<input type="text" data-bind="value: dish.name">
							</td>
						</tr>
						<tr>
							<td>所属活动</td>
							<td>
								<select data-bind="options: activitiesSel, 
								optionsValue: 'id', 
								optionsText: 'name',
								optionsCaption:'--请选择--',
								value: dish.activity.id
								"></select>
							</td>
						</tr>
						<tr>
							<td>原价</td>
							<td>
								<input type="text" data-bind="value: dish.price">元
							</td>
						</tr>
						<tr>
							<td>折扣</td>
							<td>
								<input type="text" data-bind="value: dish.discount">折
							</td>
						</tr>
						<tr>
							<td>折后价</td>
							<td>
								<input type="text" data-bind="value: dish.priceDiscounted">元
							</td>
						</tr>
						<tr>
							<td>提供时间</td>
							<td>
								<span data-bind="visible:dish.provideTimes().length == 0">
									<input type="button" value="添加" data-bind="click: $root.addPTime"><br>
								</span>
								<span data-bind="foreach: {data: dish.provideTimes, as: 'pTime'}">
									<select data-bind="value:pTime.dayOfWeek">
										<option value="1">周一</option>
										<option value="2">周二</option>
										<option value="3">周三</option>
										<option value="4">周四</option>
										<option value="5">周五</option>
										<option value="6">周六</option>
										<option value="7">周日</option>
										<option value="8">周一到周五</option>
										<option value="9">每天</option>
									</select>
									<input type="text" data-bind="value: pTime.startTime">
									至
									<input type="text" data-bind="value: pTime.endTime">
									<input type="button" value="删除" data-bind="click: function() {$root.removePTime(pTime)}">
									<input type="button" value="添加" data-bind="visible:$index() == $root.dish.provideTimes().length - 1, click: $root.addPTime"><br />
								</span>
							</td>
						</tr>
						<tr>
							<td>简介</td>
							<td>
								<input type="text" data-bind="value: dish.intro">
							</td>
						</tr>
						<tr>
							<td>详细介绍</td>
							<td>
								<textarea rows="5" cols="30" data-bind="text:dish.desc"></textarea>
							</td>
						</tr>
					</table>
				</td>
				<td>
					菜式照片
					<div id="headportrait">
						<img id="headportraitimg" data-bind="attr:{'src': '../img/dishimgtemp/' + filePath()}" alt="图像不能显示" width="180px" height="180px"/>
						<br />
		                <div id="uploadbutton" class="inline"><span></span></div>
						<span id="uploadinfo" class="inline"></span>
		            </div>
				</td>
			</tr>
		</table>
		<input type="button" value="创建菜式" data-bind="click: createDish">
	</div>
	<!-- <div id="put-dish-tab">修改小菜式</div> -->
</div>
<script type="text/javascript" src="../js/framework/jUploader/jquery.jUploader-1.01.js"></script>
<script type="text/javascript" src="../js/personnel/dish.js"></script>